﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="EditDeleteCard.ascx.vb" Inherits="Controls_EditDeleteCard" %>
    
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Id">
        <Columns>
            <asp:TemplateField HeaderText="Id" InsertVisible="False" SortExpression="Id" Visible="False">
                <EditItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="CardNumber" HeaderText="CardNumber" ReadOnly="True" SortExpression="CardNumber" />
            <asp:TemplateField HeaderText="Card Type " SortExpression="CardTypeId">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("CardTypeId") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("CardTypeId") %>' Visible="False"></asp:Label>
                    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="ObjectDataSource2" GridLines="None" ShowHeader="False" Width="100%">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                        </Columns>
                    </asp:GridView>
                    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" DeleteMethod="Delete" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="LogginsLogDSTableAdapters.usp_lkp_PaymentMethodSelectTableAdapter" UpdateMethod="Update">
                        <DeleteParameters>
                            <asp:Parameter Name="Id" Type="Int32" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="Name" Type="String" />
                            <asp:Parameter Name="Active" Type="Boolean" />
                        </InsertParameters>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="Label3" Name="Id" PropertyName="Text" Type="Int32" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="Id" Type="Int32" />
                            <asp:Parameter Name="Name" Type="String" />
                            <asp:Parameter Name="Active" Type="Boolean" />
                        </UpdateParameters>
                    </asp:ObjectDataSource>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <EditItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="Update"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandArgument='<%# Eval("Id")%>' CommandName="CustomEdit" Text="Edit"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="False" CommandArgument='<%# Eval("Id")%>' CommandName="CustomDelete" Text="Delete"></asp:LinkButton>
                    <asp:ConfirmButtonExtender ID="LinkButton4_ConfirmButtonExtender" runat="server" ConfirmText="Delete Card ?" Enabled="True" TargetControlID="LinkButton4">
                    </asp:ConfirmButtonExtender>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="CardDetailsODS" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="LogginsLogDSTableAdapters.usp_CardDetailsSelectTableAdapter" ValidateRequestMode="Disabled">
        <SelectParameters>
            <asp:Parameter Name="Id" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <%--        <asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup">--%>

        <asp:Panel ID="pnlEditCard" runat="server" CssClass="modalPopup">
            <asp:Button ID="btnCancelInvitationFail" runat="server" Style="float: right;
            background-color: #FF0000;" Text="X" />
            <h2>Edit Card Details</h2>


            <table>
                <tr>
                    <td>FirstName </td>
                    <td colspan="2">
                        <asp:TextBox ID="txtEditFirstName" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>LastName </td>
                    <td colspan="2">
                        <asp:TextBox ID="txtEditLastName" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>CardNumber </td>
                    <td colspan="2">
                        <asp:TextBox ID="txtEditCardNumber" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>L4D </td>
                    <td colspan="2">
                        <asp:TextBox ID="txtEditL4D" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>Card Type </td>
                    <td colspan="2">
                        <asp:DropDownList ID="cboCCEditType" runat="server" DataSourceID="ObjectDataSource3" DataTextField="Name" DataValueField="Id">
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" DeleteMethod="Delete" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="LogginsLogDSTableAdapters.usp_lkp_PaymentMethodSelectTableAdapter" UpdateMethod="Update">
                            <DeleteParameters>
                                <asp:Parameter Name="Id" Type="Int32" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="Name" Type="String" />
                                <asp:Parameter Name="Active" Type="Boolean" />
                            </InsertParameters>
                            <SelectParameters>
                                <asp:Parameter Name="Id" Type="Int32" />
                            </SelectParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="Id" Type="Int32" />
                                <asp:Parameter Name="Name" Type="String" />
                                <asp:Parameter Name="Active" Type="Boolean" />
                            </UpdateParameters>
                        </asp:ObjectDataSource>
                    </td>
                </tr>
                <tr>
                    <td>Valid From:</td>
                    <td colspan="2">mm
                        <asp:DropDownList ID="cboCardValidEditMM" runat="server">
                            <asp:ListItem Value="1">1</asp:ListItem>
                            <asp:ListItem Value="2">2</asp:ListItem>
                            <asp:ListItem Value="3">3</asp:ListItem>
                            <asp:ListItem Value="4">4</asp:ListItem>
                            <asp:ListItem Value="5">5</asp:ListItem>
                            <asp:ListItem Value="6">6</asp:ListItem>
                            <asp:ListItem Value="7">7</asp:ListItem>
                            <asp:ListItem Value="8">8</asp:ListItem>
                            <asp:ListItem Value="09">9</asp:ListItem>
                            <asp:ListItem Value="10">10</asp:ListItem>
                            <asp:ListItem Value="11">11</asp:ListItem>
                            <asp:ListItem Value="12">12</asp:ListItem>
                        </asp:DropDownList>
                        &nbsp;yy
                        <asp:DropDownList ID="cboCardValidEditYY" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>Expire Date: </td>
                    <td colspan="2">mm
                        <asp:DropDownList ID="cboCardExpiryEditMM" runat="server">
                            <asp:ListItem Value="1">1</asp:ListItem>
                            <asp:ListItem Value="2">2</asp:ListItem>
                            <asp:ListItem Value="3">3</asp:ListItem>
                            <asp:ListItem Value="4">4</asp:ListItem>
                            <asp:ListItem Value="5">5</asp:ListItem>
                            <asp:ListItem Value="6">6</asp:ListItem>
                            <asp:ListItem Value="7">7</asp:ListItem>
                            <asp:ListItem Value="8">8</asp:ListItem>
                            <asp:ListItem Value="09">9</asp:ListItem>
                            <asp:ListItem Value="10">10</asp:ListItem>
                            <asp:ListItem Value="11">11</asp:ListItem>
                            <asp:ListItem Value="12">12</asp:ListItem>
                        </asp:DropDownList>
                        &nbsp;yy
                        <asp:DropDownList ID="cboCardExpiryEditYY" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>CVV</td>
                    <td colspan="2">
                        <asp:TextBox ID="txtEditCVV" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:Button ID="btnSave" runat="server" Text="Save" />
                                <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
                                <br />
                                <asp:Label ID="MsgEditLbl" runat="server" Text=""></asp:Label>
                                <asp:Label ID="lblId" runat="server" Text="" Visible="false"></asp:Label>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td colspan="2">&nbsp;</td>
                </tr>
            </table>
    </asp:Panel>
    <asp:Button ID="btnEditCard" runat="server" Style="display: none;" Text="Button" />
    <asp:ModalPopupExtender ID="EditCardModalPopupExtender" runat="server" BackgroundCssClass="modalBackground" DropShadow="true" DynamicServicePath="" Enabled="True" PopupControlID="pnlEditCard" TargetControlID="btnEditCard">
    </asp:ModalPopupExtender>